package com.rovinj_server.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.telephony.TelephonyManager;
import android.widget.TextView;

import com.rovinj_server.MainActivity;
import com.rovinj_server.R;
import com.zhy.autolayout.AutoLayoutActivity;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/6/28.
 */

public class LoginActivity extends AutoLayoutActivity {

    @Bind(R.id.tv)
    TextView mTv;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        ButterKnife.bind(this);

        hidStater();//861189014464001
        TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
        String DEVICE_ID = tm.getDeviceId();
        if (DEVICE_ID.equals("861189014428998") ||DEVICE_ID.equals("861189014381551") || DEVICE_ID.equals("861189014464001") || DEVICE_ID.equals("861189014383789")) {
            startActivity(new Intent(this, MainActivity.class));
            finish();
        } else {
          mTv.setText("许可证：QWM-"+DEVICE_ID);
        }
    }


    /**
     * 隐藏状态栏
     */
    private void hidStater() {
        ActionBar actionBar = getSupportActionBar();
        actionBar.hide();
    }
}
